<template>
  <div id="app">
    <Header v-if="isFlag"></Header>
    <LeftNav class="left" v-if="isFlag"></LeftNav>
    <RightNav class="right"></RightNav>
  </div>
</template>

<script>
import Header from "./components/Header";

import LeftNav from "./components/LeftNav";

import RightNav from "./components/RightNav";
export default {
  name: "App",
  data() {
    return {
      isFlag: true,
    };
  },
  components: {
    LeftNav,
    RightNav,
    Header,
  },

  created() {},
  methods: {
    isCheckLogin() {
      let flag = localStorage.getItem("isLogin");
      // console.log('flag:',flag)
      if (flag == "false" || flag == undefined) {
        alert(1);
        flag = false;
      }
      console.log(flag);
      this.isFlag = flag;
    },
  },

  updated() {},
  mounted() {
    //这个钩子函数只走一次

    this.isCheckLogin();
  },
};
</script>

<style>
#app {
  display: flex;
  justify-content: space-around;
}
.left {
  flex: 1;
}

.right {
  flex: 6;
}
</style>
